#pragma GCC optimize(2)
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>

using namespace std;
using LL = long long;
const int N = 2e5 + 10;

int n;
int a[N];


int f(int x){
    int cnt = 0;
    while(x % 2 == 0){
        x /= 2;
        cnt ++;
    }

    return cnt;
}

void solve(){
    cin >> n;

    int oddidx = -1;
    for(int i = 1; i <= n; i ++){
        cin >> a[i];

        if(a[i] % 2) oddidx = i;
    }

    int res = 0;
    if(oddidx != -1){
        for(int i = 1; i <= n; i ++){
            if(a[i] % 2 == 0) res ++;
        }
        cout << res << '\n';
        return;
    }

    int minv = 1000000, minidx = -1;
    for(int i = 1; i <= n; i ++){
        int p = f(a[i]);
        if(p < minv){
            minv = p;
            minidx = i;
        }
    }
    res += minv;
    res += n - 1;
    cout << res << '\n';
    return;
}

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int T;
    cin >> T;
    while(T--){
        solve();
    }
    return 0;
}